package com.lenovo.lcdm.team.saml;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * saml配置表
 *
 * @author sunby1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class SamlDto implements Serializable {

    private static final long serialVersionUID = 1700039082022932480L;

    /**
     * identifier of the idp entity
     */
    @Builder.Default
    private String idpEntityId = "https://lcdm-sit.lenovo.com/adfs/loginResult";

    /**
     * idp single sign on service url
     */
    @Builder.Default
    private String idpSingleSignOnServiceUrl = "https://stscn.lenovo.com/adfs/ls";

    /**
     * idp single sign on service binding
     */
    @Builder.Default
    private String idpSingleSignOnServiceBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect";

    /**
     * idp single logout service url
     */
    @Builder.Default
    private String idpSingleLogoutServiceUrl = "https://stscn.lenovo.com/adfs/ls/?wa=wsignoutcleanup1.0";

    /**
     * idp single logout service response url
     */
    private String idpSingleLogoutServiceResponseUrl;

    /**
     * idp single logout service binding
     */
    @Builder.Default
    private String idpSingleLogoutServiceBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect";

    /**
     * idp x509cert
     */
    @Builder.Default
    private String idpx509cert = "MIIC3DCCAcSgAwIBAgIQY2vQ9iaIA6lDF9Z3mPBH6zANBgkqhkiG9w0BAQsFADAqMSgwJgYDVQQDEx9BREZTIFNpZ25pbmcgLSBzdHNjbi5sZW5vdm8uY29tMB4XDTE4MDIwNzA5MjcwOFoXDTI4MDIwNTA5MjcwOFowKjEoMCYGA1UEAxMfQURGUyBTaWduaW5nIC0gc3RzY24ubGVub3ZvLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALXaIan1a+rOWjv1jpdYQfkZiWHcUPAZLZtzDN+18OTqS+Uc+JYZAGfkws82Tx+g36Xr0WoyKbFfTSXvWiXaRAN++Zlwjy9+5/nPvZzOrl8pj7mPoGa+u97wX7pOKSPhyQDeteRe+TtN1ewEAGIANTVbW00b/HOi67ESdcu20FN1wqsqXOVnqZJJgjBX1a6Ik5MTFrVD6sVmfdGy6DAxFSYtquafWQW+YlSa6l5pRBxdSCyGC1UGaaeo6M3XeKW1xLM9dmJDesI/t4KzTd1KpvF30BLs6VcV8y5NrQXNhEcJ3KZvuKnQ1G7wdnQb7cqDb8hJOmjy+aJs94FhKF7fmAMCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAeM/VLNg51iPiRBeIT3HTzRQcp67A3DxirGLA9ViqaSSbuSgkY3TVt6/0tYchFgdJI/1RDgi7g8ggUeN/fmJm+c7pDUSNXFUEMIt1/ObWv1ZNrk4EhdQ9JxtAPLSkChIiDxPRoEYkGIHLIkYEPtNVyWsuvHbQ1aMsYuzsKhbl/qGbn6kMdyCdz2pqqg4TEMBW9/1yenyEaTnV3yq0dqcKuxkBS1sWaQqLELIYcPFGl7PF7e8gEePLaRSwL3vVMd2LcmiKmi9ybFxFJ37lDY7izJWhJqexQytxu7VL4xR3ky+9De0r3JnkDVkRCXjbehRGQdonW8JwMhPWCUZpxJTWxQ==";

    /**
     * idp certfingerprint
     */
    @Builder.Default
    private Boolean idpCertFingerprint = false;

    /**
     * idp certfingerprint algorithm
     */
    @Builder.Default
    private String idpCertFingerprintAlgorithm = "sha1";

    /**
     * saml登陆返回的用户名属性
     */
    private String idpKeyAttribute;

    /**
     * sp entity id
     */
    @Builder.Default
    private String spEntityId = "https://lcdm-sit.lenovo.com/adfs/loginResult";

    /**
     * sp assertion consumer service url
     */
    @Builder.Default
    private String spAssertionConsumerServiceUrl = "https://lcdm-sit.lenovo.com/adfs/loginResult";

    /**
     * sp assertion consumer service binding
     */
    @Builder.Default
    private String spAssertionConsumerServiceBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST";

    /**
     * sp single logout service url
     */
    @Builder.Default
    private String spSingleLogoutServiceUrl = "https://lcdm-sit.lenovo.com/adfs/loginResult";

    /**
     * sp single logout service binding
     */
    @Builder.Default
    private String spSingleLogoutServiceBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect";

    /**
     * sp nameidformat
     */
    @Builder.Default
    private String spNameIDFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";

    /**
     * sp x509cert
     */
    @Builder.Default
    private String spX509cert = null;

    /**
     * sp PrivateKey
     */
    @Builder.Default
    private String spPrivateKey = null;;


    /**
     * saml strict
     */
    @Builder.Default
    private Boolean strict = false;

    /**
     * saml security nameid encrypted
     */
    @Builder.Default
    private Boolean nameIdEncrypted = false;

    /**
     * saml security authnrequest signed
     */
    @Builder.Default
    private Boolean authnRequestsSigned = false;

    /**
     * saml security logoutrequest signed
     */
    @Builder.Default
    private Boolean logoutRequestSigned = false;

    /**
     * saml security logoutresponse signed
     */
    @Builder.Default
    private Boolean logoutResponseSigned = false;

    /**
     * saml security want messages signed
     */
    @Builder.Default
    private Boolean wantMessagesSigned = false;

    /**
     * saml security want assertions signed
     */
    @Builder.Default
    private Boolean wantAssertionsSigned = false;

    /**
     * saml security want assertions encrypted
     */
    @Builder.Default
    private Boolean wantAssertionsEncrypted = false;

    /**
     * saml security want _nameid
     */
    @Builder.Default
    private Boolean wantNameId = false;

    /**
     * saml security want nameid encrypted
     */
    @Builder.Default
    private Boolean wantNameIdEncrypted = false;

    /**
     * saml security sign metadata
     */
    @Builder.Default
    private Boolean signMetadata = false;

    /**
     * saml security requested authncontext
     */
    private String requestedAuthnContext;

    /**
     * saml security requested authncontextcomparison
     */
    private String requestedAuthnContextComparison;

    /**
     * saml security want xml validation
     */
    @Builder.Default
    private Boolean wantXMLValidation = true;

    /**
     * saml security nameid encrypted
     */
    @Builder.Default
    private String signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";

    /**
     * saml organization name
     */
    @Builder.Default
    private String orgName = "SP Java";

    /**
     * saml organization displayname
     */
    @Builder.Default
    private String orgDisplayName = "SP Java Example";

}
